/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package br.com.proteu.facesbeans.view.agendadomedico;

import br.com.proteu.hibernate.beans.AgendamentoProteu;
import br.com.proteu.hibernate.beans.EspecialidadesClinicaProteu;
import br.com.proteu.hibernate.beans.MedicosHorariosProteu;
import br.com.proteu.hibernate.beans.MedicosProteu;
import br.com.proteu.hibernate.beans.UnidadesProteu;
import br.com.proteu.hibernate.util.FireBirdHelperProteu;
import java.io.Serializable;
import java.util.Collections;
import java.util.Comparator;
import java.util.Date;
import java.util.List;
import javax.faces.model.SelectItem;

/**
 *
 * @author ricardo
 */

public class AgendaDoMedicoView {


    protected Date dtStart  = new Date();
    protected Date dtEnd  = new Date();
    protected Date dtStart2  = new Date();
    protected Date dtEnd2  = new Date();

    protected String strHrInicio = "08:00";
    protected String strHrFinal = "18:00";
    protected String strIntervalo = "20";

    protected String strUnidadeBusca;
    protected String strMedicoBusca;
    protected String strEspecialidade;
    
    protected String  strDiarioSemanal = "D";
    protected boolean  blDiario = true;

    protected boolean  blSun = false;
    protected boolean  blMon = true;
    protected boolean  blTue = true;
    protected boolean  blWed = true;
    protected boolean  blThu= true;
    protected boolean  blFri = true;
    protected boolean  blSat = false;
  

    protected String strUrlInclude = "agendadomedicodiariapop.jspx";


    protected Character mehStCodigo;
    protected String medStCodigo;
    protected String mehChDomingo;
    protected boolean mehBlDomingo;
    protected String mehChSegunda;
    protected boolean mehBlSegunda;
    protected String mehChTerca;
    protected boolean mehBlTerca;
    protected String mehChQuarta;
    protected boolean mehBlQuarta;
    protected String mehChQuinta;
    protected boolean mehBlQuinta;
    protected String mehChSexta;
    protected boolean mehBlSexta;
    protected String mehChSabado;
    protected boolean mehBlSabado;
    protected String mehStIntervalo;
    protected String mehStInimDom;
    protected String mehStFimmDom;
    protected String mehStInitDom;
    protected String mehStFimtDom;
    protected String mehStIninDom;
    protected String mehStFimnDom;
    protected String mehStInimSeg;
    protected String mehStFimmSeg;
    protected String mehStInitSeg;
    protected String mehStFimtSeg;
    protected String mehStIninSeg;
    protected String mehStFimnSeg;
    protected String mehStInimTer;
    protected String mehStFimmTer;
    protected String mehStInitTer;
    protected String mehStFimtTer;
    protected String mehStIninTer;
    protected String mehStFimnTer;
    protected String mehStInimQua;
    protected String mehStFimmQua;
    protected String mehStInitQua;
    protected String mehStFimtQua;
    protected String mehStIninQua;
    protected String mehStFimnQua;
    protected String mehStInimQui;
    protected String mehStFimmQui;
    protected String mehStInitQui;
    protected String mehStFimtQui;
    protected String mehStIninQui;
    protected String mehStFimnQui;
    protected String mehStInimSex;
    protected String mehStFimmSex;
    protected String mehStInitSex;
    protected String mehStFimtSex;
    protected String mehStIninSex;
    protected String mehStFimnSex;
    protected String mehStInimSab;
    protected String mehStFimmSab;
    protected String mehStInitSab;
    protected String mehStFimtSab;
    protected String mehStIninSab;
    protected String mehStFimnSab;
    protected Date mehSysData;
    protected String mehSysUsuario;
    protected Integer uniInCodigo;
    protected String escStCodigo;

    protected boolean blPopUp = false;



    protected UnidadesProteu unidades;
    protected EspecialidadesClinicaProteu especialidades;
    protected MedicosProteu medicos;
    protected MedicosHorariosProteu medicosHorarios;
    protected List listMedicosHorarios;
    protected  List<AgendamentoProteu> listAgendamentoProteu;
    protected  List<AgendamentoProteu> listAgendamentoProteubyDay;

    public boolean isBlFri() {
        return blFri;
    }

    public void setBlFri(boolean blFri) {
        this.blFri = blFri;
    }

    public boolean isBlMon() {
        return blMon;
    }

    public void setBlMon(boolean blMon) {
        this.blMon = blMon;
    }

    public boolean isBlSat() {
        return blSat;
    }

    public void setBlSat(boolean blSat) {
        this.blSat = blSat;
    }

    public boolean isBlSun() {
        return blSun;
    }

    public void setBlSun(boolean blSun) {
        this.blSun = blSun;
    }

    public boolean isBlThu() {
        return blThu;
    }

    public void setBlThu(boolean blThu) {
        this.blThu = blThu;
    }

    public boolean isBlTue() {
        return blTue;
    }

    public void setBlTue(boolean blTue) {
        this.blTue = blTue;
    }

    public boolean isBlWed() {
        return blWed;
    }

    public void setBlWed(boolean blWed) {
        this.blWed = blWed;
    }

    public List<AgendamentoProteu> getListAgendamentoProteubyDay() {
        return listAgendamentoProteubyDay;
    }

    public void setListAgendamentoProteubyDay(List<AgendamentoProteu> listAgendamentoProteubyDay) {
        this.listAgendamentoProteubyDay = listAgendamentoProteubyDay;
    }

    
    public List<AgendamentoProteu> getListAgendamentoProteu() {
        return listAgendamentoProteu;
    }

    public void setListAgendamentoProteu(List<AgendamentoProteu> listAgendamentoProteu) {
        this.listAgendamentoProteu = listAgendamentoProteu;
    }


    
    public Date getDtEnd() {
        return dtEnd;
    }

    public void setDtEnd(Date dtEnd) {
        this.dtEnd = dtEnd;
        this.dtEnd2 = dtEnd;
    }

  

    public Date getDtStart() {
        return dtStart;
    }

    public void setDtStart(Date dtStart) {
        this.dtStart = dtStart;
        this.dtStart2 = dtStart;
    }

    public Date getDtEnd2() {
        return dtEnd2;
    }

    public void setDtEnd2(Date dtEnd2) {
        this.dtEnd2 = dtEnd2;

    }

    public Date getDtStart2() {
        return dtStart2;
    }

    public void setDtStart2(Date dtStart2) {
        this.dtStart2 = dtStart2;
    }

    public String getStrHrFinal() {
        return strHrFinal;
    }

    public void setStrHrFinal(String strHrFinal) {
        this.strHrFinal = strHrFinal;
    }

    public String getStrHrInicio() {
        return strHrInicio;
    }

    public void setStrHrInicio(String strHrInicio) {
        this.strHrInicio = strHrInicio;
    }

    public boolean isBlDiario() {
        return blDiario;
    }

    public void setBlDiario(boolean blDiario) {
        this.blDiario = blDiario;
    }


    
    public String getStrUrlInclude() {
        return strUrlInclude;
    }

    public void setStrUrlInclude(String strUrlInclude) {
        this.strUrlInclude = strUrlInclude;
    }



    public String getStrDiarioSemanal() {
        return strDiarioSemanal;
    }

    public void setStrDiarioSemanal(String strDiarioSemanal) {
        this.strDiarioSemanal = strDiarioSemanal;
    }
  
    public String getStrIntervalo() {
        return strIntervalo;
    }


    public void setStrIntervalo(String strIntervalo) {
        this.strIntervalo = strIntervalo;
    }


    public List getListMedicosHorarios() {
        return listMedicosHorarios;
    }

    public void setListMedicosHorarios(List listMedicosHorarios) {
        this.listMedicosHorarios = listMedicosHorarios;
    }

    public boolean isBlPopUp() {
        return blPopUp;
    }

    public void setBlPopUp(boolean blPopUp) {
        this.blPopUp = blPopUp;
    }

    public String getEscStCodigo() {
        return escStCodigo;
    }

    public void setEscStCodigo(String escStCodigo) {
        this.escStCodigo = escStCodigo;
    }

    public String getMedStCodigo() {
        return medStCodigo;
    }

    public void setMedStCodigo(String medStCodigo) {
        this.medStCodigo = medStCodigo;
    }

    public String getMehChDomingo() {
        return mehChDomingo;
    }

    public void setMehChDomingo(String mehChDomingo) {
        this.mehChDomingo = mehChDomingo;
    }

    public String getMehChQuarta() {
        return mehChQuarta;
    }

    public void setMehChQuarta(String mehChQuarta) {
        this.mehChQuarta = mehChQuarta;
    }

    public String getMehChQuinta() {
        return mehChQuinta;
    }

    public void setMehChQuinta(String mehChQuinta) {
        this.mehChQuinta = mehChQuinta;
    }

    public String getMehChSabado() {
        return mehChSabado;
    }

    public void setMehChSabado(String mehChSabado) {
        this.mehChSabado = mehChSabado;
    }

    public String getMehChSegunda() {
        return mehChSegunda;
    }

    public void setMehChSegunda(String mehChSegunda) {
        this.mehChSegunda = mehChSegunda;
    }

    public String getMehChSexta() {
        return mehChSexta;
    }

    public void setMehChSexta(String mehChSexta) {
        this.mehChSexta = mehChSexta;
    }

    public String getMehChTerca() {
        return mehChTerca;
    }

    public void setMehChTerca(String mehChTerca) {
        this.mehChTerca = mehChTerca;
    }

    public Character getMehStCodigo() {
        return mehStCodigo;
    }

    public void setMehStCodigo(Character mehStCodigo) {
        this.mehStCodigo = mehStCodigo;
    }

    public String getMehStFimmDom() {
        return mehStFimmDom;
    }

    public void setMehStFimmDom(String mehStFimmDom) {
        this.mehStFimmDom = mehStFimmDom;
    }

    public String getMehStFimmQua() {
        return mehStFimmQua;
    }

    public void setMehStFimmQua(String mehStFimmQua) {
        this.mehStFimmQua = mehStFimmQua;
    }

    public String getMehStFimmQui() {
        return mehStFimmQui;
    }

    public void setMehStFimmQui(String mehStFimmQui) {
        this.mehStFimmQui = mehStFimmQui;
    }

    public String getMehStFimmSab() {
        return mehStFimmSab;
    }

    public void setMehStFimmSab(String mehStFimmSab) {
        this.mehStFimmSab = mehStFimmSab;
    }

    public String getMehStFimmSeg() {
        return mehStFimmSeg;
    }

    public void setMehStFimmSeg(String mehStFimmSeg) {
        this.mehStFimmSeg = mehStFimmSeg;
    }

    public String getMehStFimmSex() {
        return mehStFimmSex;
    }

    public void setMehStFimmSex(String mehStFimmSex) {
        this.mehStFimmSex = mehStFimmSex;
    }

    public String getMehStFimmTer() {
        return mehStFimmTer;
    }

    public void setMehStFimmTer(String mehStFimmTer) {
        this.mehStFimmTer = mehStFimmTer;
    }

    public String getMehStFimnDom() {
        return mehStFimnDom;
    }

    public void setMehStFimnDom(String mehStFimnDom) {
        this.mehStFimnDom = mehStFimnDom;
    }

    public String getMehStFimnQua() {
        return mehStFimnQua;
    }

    public void setMehStFimnQua(String mehStFimnQua) {
        this.mehStFimnQua = mehStFimnQua;
    }

    public String getMehStFimnQui() {
        return mehStFimnQui;
    }

    public void setMehStFimnQui(String mehStFimnQui) {
        this.mehStFimnQui = mehStFimnQui;
    }

    public String getMehStFimnSab() {
        return mehStFimnSab;
    }

    public void setMehStFimnSab(String mehStFimnSab) {
        this.mehStFimnSab = mehStFimnSab;
    }

    public String getMehStFimnSeg() {
        return mehStFimnSeg;
    }

    public void setMehStFimnSeg(String mehStFimnSeg) {
        this.mehStFimnSeg = mehStFimnSeg;
    }

    public String getMehStFimnSex() {
        return mehStFimnSex;
    }

    public void setMehStFimnSex(String mehStFimnSex) {
        this.mehStFimnSex = mehStFimnSex;
    }

    public String getMehStFimnTer() {
        return mehStFimnTer;
    }

    public void setMehStFimnTer(String mehStFimnTer) {
        this.mehStFimnTer = mehStFimnTer;
    }

    public String getMehStFimtDom() {
        return mehStFimtDom;
    }

    public void setMehStFimtDom(String mehStFimtDom) {
        this.mehStFimtDom = mehStFimtDom;
    }

    public String getMehStFimtQua() {
        return mehStFimtQua;
    }

    public void setMehStFimtQua(String mehStFimtQua) {
        this.mehStFimtQua = mehStFimtQua;
    }

    public String getMehStFimtQui() {
        return mehStFimtQui;
    }

    public void setMehStFimtQui(String mehStFimtQui) {
        this.mehStFimtQui = mehStFimtQui;
    }

    public String getMehStFimtSab() {
        return mehStFimtSab;
    }

    public void setMehStFimtSab(String mehStFimtSab) {
        this.mehStFimtSab = mehStFimtSab;
    }

    public String getMehStFimtSeg() {
        return mehStFimtSeg;
    }

    public void setMehStFimtSeg(String mehStFimtSeg) {
        this.mehStFimtSeg = mehStFimtSeg;
    }

    public String getMehStFimtSex() {
        return mehStFimtSex;
    }

    public void setMehStFimtSex(String mehStFimtSex) {
        this.mehStFimtSex = mehStFimtSex;
    }

    public String getMehStFimtTer() {
        return mehStFimtTer;
    }

    public void setMehStFimtTer(String mehStFimtTer) {
        this.mehStFimtTer = mehStFimtTer;
    }

    public String getMehStInimDom() {
        return mehStInimDom;
    }

    public void setMehStInimDom(String mehStInimDom) {
        this.mehStInimDom = mehStInimDom;
    }

    public String getMehStInimQua() {
        return mehStInimQua;
    }

    public void setMehStInimQua(String mehStInimQua) {
        this.mehStInimQua = mehStInimQua;
    }

    public String getMehStInimQui() {
        return mehStInimQui;
    }

    public void setMehStInimQui(String mehStInimQui) {
        this.mehStInimQui = mehStInimQui;
    }

    public String getMehStInimSab() {
        return mehStInimSab;
    }

    public void setMehStInimSab(String mehStInimSab) {
        this.mehStInimSab = mehStInimSab;
    }

    public String getMehStInimSeg() {
        return mehStInimSeg;
    }

    public void setMehStInimSeg(String mehStInimSeg) {
        this.mehStInimSeg = mehStInimSeg;
    }

    public String getMehStInimSex() {
        return mehStInimSex;
    }

    public void setMehStInimSex(String mehStInimSex) {
        this.mehStInimSex = mehStInimSex;
    }

    public String getMehStInimTer() {
        return mehStInimTer;
    }

    public void setMehStInimTer(String mehStInimTer) {
        this.mehStInimTer = mehStInimTer;
    }

    public String getMehStIninDom() {
        return mehStIninDom;
    }

    public void setMehStIninDom(String mehStIninDom) {
        this.mehStIninDom = mehStIninDom;
    }

    public String getMehStIninQua() {
        return mehStIninQua;
    }

    public void setMehStIninQua(String mehStIninQua) {
        this.mehStIninQua = mehStIninQua;
    }

    public String getMehStIninQui() {
        return mehStIninQui;
    }

    public void setMehStIninQui(String mehStIninQui) {
        this.mehStIninQui = mehStIninQui;
    }

    public String getMehStIninSab() {
        return mehStIninSab;
    }

    public void setMehStIninSab(String mehStIninSab) {
        this.mehStIninSab = mehStIninSab;
    }

    public String getMehStIninSeg() {
        return mehStIninSeg;
    }

    public void setMehStIninSeg(String mehStIninSeg) {
        this.mehStIninSeg = mehStIninSeg;
    }

    public String getMehStIninSex() {
        return mehStIninSex;
    }

    public void setMehStIninSex(String mehStIninSex) {
        this.mehStIninSex = mehStIninSex;
    }

    public String getMehStIninTer() {
        return mehStIninTer;
    }

    public void setMehStIninTer(String mehStIninTer) {
        this.mehStIninTer = mehStIninTer;
    }

    public String getMehStInitDom() {
        return mehStInitDom;
    }

    public void setMehStInitDom(String mehStInitDom) {
        this.mehStInitDom = mehStInitDom;
    }

    public String getMehStInitQua() {
        return mehStInitQua;
    }

    public void setMehStInitQua(String mehStInitQua) {
        this.mehStInitQua = mehStInitQua;
    }

    public String getMehStInitQui() {
        return mehStInitQui;
    }

    public void setMehStInitQui(String mehStInitQui) {
        this.mehStInitQui = mehStInitQui;
    }

    public String getMehStInitSab() {
        return mehStInitSab;
    }

    public void setMehStInitSab(String mehStInitSab) {
        this.mehStInitSab = mehStInitSab;
    }

    public String getMehStInitSeg() {
        return mehStInitSeg;
    }

    public void setMehStInitSeg(String mehStInitSeg) {
        this.mehStInitSeg = mehStInitSeg;
    }

    public String getMehStInitSex() {
        return mehStInitSex;
    }

    public void setMehStInitSex(String mehStInitSex) {
        this.mehStInitSex = mehStInitSex;
    }

    public String getMehStInitTer() {
        return mehStInitTer;
    }

    public void setMehStInitTer(String mehStInitTer) {
        this.mehStInitTer = mehStInitTer;
    }

    public String getMehStIntervalo() {
        return mehStIntervalo;
    }

    public void setMehStIntervalo(String mehStIntervalo) {
        this.mehStIntervalo = mehStIntervalo;
    }

    public Date getMehSysData() {
        return mehSysData;
    }

    public void setMehSysData(Date mehSysData) {
        this.mehSysData = mehSysData;
    }

    public String getMehSysUsuario() {
        return mehSysUsuario;
    }

    public void setMehSysUsuario(String mehSysUsuario) {
        this.mehSysUsuario = mehSysUsuario;
    }

    public Integer getUniInCodigo() {
        return uniInCodigo;
    }

    public void setUniInCodigo(Integer uniInCodigo) {
        this.uniInCodigo = uniInCodigo;
    }

    public boolean isMehBlDomingo() {
        return mehBlDomingo;
    }

    public void setMehBlDomingo(boolean mehBlDomingo) {
        this.mehBlDomingo = mehBlDomingo;
    }

    public boolean isMehBlQuarta() {
        return mehBlQuarta;
    }

    public void setMehBlQuarta(boolean mehBlQuarta) {
        this.mehBlQuarta = mehBlQuarta;
    }

    public boolean isMehBlQuinta() {
        return mehBlQuinta;
    }

    public void setMehBlQuinta(boolean mehBlQuinta) {
        this.mehBlQuinta = mehBlQuinta;
    }

    public boolean isMehBlSabado() {
        return mehBlSabado;
    }

    public void setMehBlSabado(boolean mehBlSabado) {
        this.mehBlSabado = mehBlSabado;
    }

    public boolean isMehBlSegunda() {
        return mehBlSegunda;
    }

    public void setMehBlSegunda(boolean mehBlSegunda) {
        this.mehBlSegunda = mehBlSegunda;
    }

    public boolean isMehBlSexta() {
        return mehBlSexta;
    }

    public void setMehBlSexta(boolean mehBlSexta) {
        this.mehBlSexta = mehBlSexta;
    }

    public boolean isMehBlTerca() {
        return mehBlTerca;
    }

    public void setMehBlTerca(boolean mehBlTerca) {
        this.mehBlTerca = mehBlTerca;
    }

  
    public String getStrEspecialidade() {
        return strEspecialidade;
    }

    public void setStrEspecialidade(String strEspecialidade) {
        this.strEspecialidade = strEspecialidade;
    }

  
    public EspecialidadesClinicaProteu getEspecialidades() {
        return especialidades;
    }

    public void setEspecialidades(EspecialidadesClinicaProteu especialidades) {
        this.especialidades = especialidades;
    }

    public MedicosProteu getMedicos() {
        if(medicos == null && strMedicoBusca != null){
            medicos = (MedicosProteu)FireBirdHelperProteu.getObject(MedicosProteu.class, strMedicoBusca);
        }
        return medicos;
    }

    public void setMedicos(MedicosProteu medicos) {
        this.medicos = medicos;
    }

    public UnidadesProteu getUnidades() {
        if( unidades == null &&  strUnidadeBusca != null){
            unidades = (UnidadesProteu) FireBirdHelperProteu.getObject(UnidadesProteu.class, new Integer(strUnidadeBusca) );
        }
        return unidades;
    }

    public void setUnidades(UnidadesProteu unidades) {
        this.unidades = unidades;
    }

    public MedicosHorariosProteu getMedicosHorarios() {
        return medicosHorarios;
    }

    public void setMedicosHorarios(MedicosHorariosProteu medicosHorarios) {
        this.medicosHorarios = medicosHorarios;
    }

    public String getStrMedicoBusca() {
        return strMedicoBusca;
    }

    public void setStrMedicoBusca(String strMedicoBusca) {
        this.strMedicoBusca = strMedicoBusca;
    }

    public String getStrUnidadeBusca() {
        return strUnidadeBusca;
    }

    public void setStrUnidadeBusca(String strUnidadeBusca) {
        this.strUnidadeBusca = strUnidadeBusca;
    }





    protected void everyThing(){
        if(medicosHorarios != null){
            mehStCodigo = medicosHorarios.getMehStCodigo();
            medStCodigo = medicosHorarios.getMedStCodigo();
            mehChDomingo = medicosHorarios.getMehChDomingo();
            if(medicosHorarios.getMehChDomingo() != null && medicosHorarios.getMehChDomingo().toString().equalsIgnoreCase("S")){mehBlDomingo = true;}else{mehBlDomingo = false;}
            mehChSegunda = medicosHorarios.getMehChSegunda();
            if(medicosHorarios.getMehChSegunda() != null && medicosHorarios.getMehChSegunda().toString().equalsIgnoreCase("S")){mehBlSegunda = true;}else{mehBlSegunda = false;}
            mehChTerca = medicosHorarios.getMehChTerca();
            if(medicosHorarios.getMehChTerca() != null && medicosHorarios.getMehChTerca().toString().equalsIgnoreCase("S")){mehBlTerca = true;}else{mehBlTerca = false;}
            mehChQuarta = medicosHorarios.getMehChQuarta();
            if(medicosHorarios.getMehChQuarta() != null && medicosHorarios.getMehChQuarta().toString().equalsIgnoreCase("S")){mehBlQuarta = true;}else{mehBlQuarta = false;}
            mehChQuinta = medicosHorarios.getMehChQuinta();
            if(medicosHorarios.getMehChQuinta() != null && medicosHorarios.getMehChQuinta().toString().equalsIgnoreCase("S")){mehBlQuinta = true;}else{mehBlQuinta = false;}
            mehChSexta = medicosHorarios.getMehChSexta();
            if(medicosHorarios.getMehChSexta() != null && medicosHorarios.getMehChSexta().toString().equalsIgnoreCase("S")){mehBlSexta = true;}else{mehBlSexta = false;}
            mehChSabado = medicosHorarios.getMehChSabado();
            if(medicosHorarios.getMehChSabado() != null && medicosHorarios.getMehChSabado().toString().equalsIgnoreCase("S")){mehBlSabado = true;}else{mehBlSabado = false;}
            mehStIntervalo = medicosHorarios.getMehStIntervalo();
            mehStInimDom = medicosHorarios.getMehStInimDom();
            mehStFimmDom = medicosHorarios.getMehStFimmDom();
            mehStInitDom = medicosHorarios.getMehStInitDom();
            mehStFimtDom = medicosHorarios.getMehStFimtDom();
            mehStIninDom = medicosHorarios.getMehStIninDom();
            mehStFimnDom = medicosHorarios.getMehStFimnDom();
            mehStInimSeg = medicosHorarios.getMehStInimSeg();
            mehStFimmSeg = medicosHorarios.getMehStFimmSeg();
            mehStInitSeg = medicosHorarios.getMehStInitSeg();
            mehStFimtSeg = medicosHorarios.getMehStFimtSeg();
            mehStIninSeg = medicosHorarios.getMehStIninSeg();
            mehStFimnSeg = medicosHorarios.getMehStFimnSeg();
            mehStInimTer = medicosHorarios.getMehStInimTer();
            mehStFimmTer = medicosHorarios.getMehStFimmTer();
            mehStInitTer = medicosHorarios.getMehStInitTer();
            mehStFimtTer = medicosHorarios.getMehStFimtTer();
            mehStIninTer = medicosHorarios.getMehStIninTer();
            mehStFimnTer = medicosHorarios.getMehStFimnTer();
            mehStInimQua = medicosHorarios.getMehStInimQua();
            mehStFimmQua = medicosHorarios.getMehStFimmQua();
            mehStInitQua = medicosHorarios.getMehStInitQua();
            mehStFimtQua = medicosHorarios.getMehStFimtQua();
            mehStIninQua = medicosHorarios.getMehStIninQua();
            mehStFimnQua = medicosHorarios.getMehStFimnQua();
            mehStInimQui = medicosHorarios.getMehStInimQui();
            mehStFimmQui = medicosHorarios.getMehStFimmQui();
            mehStInitQui = medicosHorarios.getMehStInitQui();
            mehStFimtQui = medicosHorarios.getMehStFimtQui();
            mehStIninQui = medicosHorarios.getMehStIninQui();
            mehStFimnQui = medicosHorarios.getMehStFimnQui();
            mehStInimSex = medicosHorarios.getMehStInimSex();
            mehStFimmSex = medicosHorarios.getMehStFimmSex();
            mehStInitSex = medicosHorarios.getMehStInitSex();
            mehStFimtSex = medicosHorarios.getMehStFimtSex();
            mehStIninSex = medicosHorarios.getMehStIninSex();
            mehStFimnSex = medicosHorarios.getMehStFimnSex();
            mehStInimSab = medicosHorarios.getMehStInimSab();
            mehStFimmSab = medicosHorarios.getMehStFimmSab();
            mehStInitSab = medicosHorarios.getMehStInitSab();
            mehStFimtSab = medicosHorarios.getMehStFimtSab();
            mehStIninSab = medicosHorarios.getMehStIninSab();
            mehStFimnSab = medicosHorarios.getMehStFimnSab();
            mehSysData = medicosHorarios.getMehSysData();
            mehSysUsuario = medicosHorarios.getMehSysUsuario();
            uniInCodigo = medicosHorarios.getUniInCodigo();
            escStCodigo = medicosHorarios.getEscStCodigo();
        }

    }

    protected void everythingToNull(){
            mehStCodigo = null;
            medStCodigo = null;
            mehChDomingo = null;
            mehBlDomingo = false;
            mehChSegunda = null;
            mehBlSegunda = false;
            mehChTerca = null;
            mehBlTerca = false;
            mehChQuarta = null;
            mehBlQuarta = false;
            mehChQuinta = null;
            mehBlQuinta = false;
            mehChSexta = null;
            mehBlSexta = false;
            mehChSabado = null;
            mehBlSabado = false;
            mehStIntervalo = null;
            mehStInimDom = null;
            mehStFimmDom = null;
            mehStInitDom = null;
            mehStFimtDom = null;
            mehStIninDom = null;
            mehStFimnDom = null;
            mehStInimSeg = null;
            mehStFimmSeg = null;
            mehStInitSeg = null;
            mehStFimtSeg = null;
            mehStIninSeg = null;
            mehStFimnSeg = null;
            mehStInimTer = null;
            mehStFimmTer = null;
            mehStInitTer = null;
            mehStFimtTer = null;
            mehStIninTer = null;
            mehStFimnTer = null;
            mehStInimQua = null;
            mehStFimmQua = null;
            mehStInitQua = null;
            mehStFimtQua = null;
            mehStIninQua = null;
            mehStFimnQua = null;
            mehStInimQui = null;
            mehStFimmQui = null;
            mehStInitQui = null;
            mehStFimtQui = null;
            mehStIninQui = null;
            mehStFimnQui = null;
            mehStInimSex = null;
            mehStFimmSex = null;
            mehStInitSex = null;
            mehStFimtSex = null;
            mehStIninSex = null;
            mehStFimnSex = null;
            mehStInimSab = null;
            mehStFimmSab = null;
            mehStInitSab = null;
            mehStFimtSab = null;
            mehStIninSab = null;
            mehStFimnSab = null;
            mehSysData = null;
            mehSysUsuario = null;
            uniInCodigo = null;
            escStCodigo = null;
    }

    public void grabListAgendas(){
        this.listMedicosHorarios = (List<MedicosHorariosProteu>)FireBirdHelperProteu.getListObject(MedicosHorariosProteu.class);
        if(listMedicosHorarios != null && listMedicosHorarios.size()>0){
            blPopUp = true;
        }else{
            blPopUp = false;
        }

    }

    public void closeListMedicoHrPopUp(){
        blPopUp = false;
    }


//    public void saveAgendaToDB(){
//        MedicosHorariosProteu
//    }

}